package io;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class demo6 {
    public static void main(String[] args) throws IOException {
        File file = new File("./test.txt");
        if (!file.exists()) {
            file.createNewFile();
        }

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入内容");
        String s = scanner.nextLine();

        File file2 = new File("./test2.txt");
        file.renameTo(file2);

    }
}   
